
function showfilediv() {
		if(document.getElementById("imgurl").value !="" ){
		$("#imgdiv").show();
		$("#trimgdiv").show();
		}
}






 $(function() {
           $("#imgBtn").click(function() {
                    var  flag = 1;
                    if (document.getElementById("imgFlag1").checked == true){
                       flag = 0
                    }
					var txt = '<form   action="information_preview.shtml?hotActivity='+flag+'"' 
							+ 'method="post" enctype="multipart/form-data" target="tempF">'
							+ '<input name="imageFile" id="imageFile" type="file" /><input id="sub" type="submit" style="display: none" /></form>';
					function mysubmitfunc(v, m, f) {
						if(!/(.gif)|(.png)|(.jpg)|(.jpeg)|(.GIF)|(.PNG)|(.JPG)|(.JPEG)|(.IOC)|(.ico)$/.exec($("#imageFile").val())){
							 $.prompt('请上传图片格式文件',{show:'slideDown',buttons:{OK:true}})
							 return false;
						}
						$("#sub").click();
						return true;
					}
					$.prompt(txt, {
								submit : mysubmitfunc,
								buttons : {
									Ok : true
								}
							});
				})
				
        });
        
 function  goback(){
		            window.location.href="history(-1)";
	}    
	
	
	   
	function bigCategoryChange(){
	var bigCategoryValue = $("#bigCategory option:selected").val();
	if(bigCategoryValue != ""){
		$('#smallCategory').html('加载中... ...');
		$.get('../category/category_loadCategoryByPid.shtml?id='+bigCategoryValue+'&t='+new Date().getTime().toString(36),function(mes){
			var json = eval('('+mes+')');
			var str = '<select name="tgInformation.categoryId" id="categoryId"  ><option value="-1">请选择</option>';
			for(var i = 0; i < json.length; i++){
				str += '<option value="'+json[i]['id']+'">'+json[i]['name']+'</option>';
			}
			str+='</select>';
			$('#smallCategory').html(str);
		})
	}
}
	
	
 function checkform(){
     var hotflag= $("input[name='tgInformation.hot']:checked").val();
    if(hotflag==1)
    {
       if($('#the1').val() ==""){
         alert("热点资讯：'摘要1'不能为空！");
          return false;
       } if($('#the2').val() ==""){
         alert("热点资讯：'摘要2'不能为空！");
          return false;
       }
    }
 
 
   var categoryId=  document.getElementById("bigCategory").value;
    if(categoryId==-1)
    {
       alert("请选择行业");
       return false;
    }
    return true;
}



function showimgdiv(obj){
   if(obj.value==2){
       document.getElementById("trimgdiv").style.display = "none";
   }else{
    document.getElementById("trimgdiv").style.display = "block";
   }
}  